<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="ISO-8859-1"%>
<%@include file="header.jsp" %>
<h3>Search for a seed</h3>
<form action="Search">
    <p><b>Search by:</b> 
        <select name="searchby">
                                <option value="cname">Common Name</option>
                                <option value="sname">Scientific Name</option>
                                <option value="hardiness">Hardiness Zone</option>
                                <option value="farmer">Farmer Name</option>
                                
                            </select>
        
    <p><input type="text" name="criteria" /><br/>
                Your interests</p>
            
            <input type="submit" value="Search">
    
    
</form>
<div id="results">
    <table>
        <tr><th>Name</th><th>Scientific Name</th><th>Region</th><th>Start Season</th><th>End Season</th></tr>
    ${results}
    </table>
    <%
      /*                String results = request.getParameter("seeds");
                      if (results != null) {
                          out.println("<table>");
                          out.println("<tr><th>Name</th><th>Scientific Name</th><th>Region</th><th>Start Season</th><th>End Season</th></tr>");
                         out.println(results);
                         out.println("</table>");
                         /*
 *                          result format: 
 *                          <tr><td><a href=seed?id='idnum'>seed common name</a></td><td>scientific name</td><td>region</td><td>start month</td><td>end month</td></tr>
 *                          save as string, concatenate each seed to the result
 *                          output result as follows in servlet(unless you have cleaner way):
 *                          String head = request.getHeader("Referer");
                                if(head.contains("?")){
                                    head=head.substring(0,head.indexOf("?"));
                                }
				response.sendRedirect(head +"?seeds=-insert seed string here-");
 *  
 *                          that should work
 *                          
 *                          
                       } else{
                          out.println("<p>No seeds found! Try new search.</p>");
                       }
                          */  %>
    
</div>
<%@include file="footer.html" %>